/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package loadphase;

import elementos.Drawable;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author pedro
 */
public class FichPhase implements PhaseLoader{

    @Override
    public Object loadPhase(int p) {
        FileInputStream file;
        try {
            //cargamos el fichero
            //String name= Fich
            file = new FileInputStream("/Users/pedro/fase"+p+".txt");
                // creamos un objeto para leer del fichero
                ObjectInputStream in = new ObjectInputStream(file);
                Object obj;   
                obj = in.readObject();
                in.close();
                file.close();
                return obj;
            } catch (Exception ex) {
            Logger.getLogger(FichPhase.class.getName()).log(Level.SEVERE, null, ex);
return null;
        }
        
    }
    
}
